﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Decisions.HL7.Parser
{
    public interface ITypeCreator {

        Type GetTypeForName(string name);

        Type[] GetAllSegmentTypes();

    }

    public static class TypeCreatorRegistry
    {
        private static ITypeCreator internalCreator;

        public static ITypeCreator Creator {

            get {

                if (internalCreator == null) {

                    internalCreator = new DefaultHL7TypeCreator();

                }
                return internalCreator;

            }
            set {
                internalCreator = value;
            }
        }

    }
}
